using System;
using System.Collections.Generic;
using System.Text;

using Koossery.MVCwin.Actions.itf;
using Koossery.MVCwin.ControllerManager.itf;

namespace Koossery.MVCwin.Actions.impl
{
	/// <author>Mohamadou Yacoubou</author>
	/// <summary>
	/// The specific Render view action result. It's display a view
    /// </summary>
    /// <remarks>
    /// The class is marked as internal class, so that it's not accessible from a development project
    /// </remarks>
	public  class ViewResult : IActionResult
	{
		#region Fields

		/// <summary>
		/// The name of the view to display
		/// </summary>
		private string _viewName;

		#endregion Fields

		#region Constructors

		/// <summary>
		/// Constructor. Injecting the view name using the constructor
		/// </summary>
		/// <param name="viewName"></param>
		internal ViewResult(string viewName)
		{
			this._viewName = viewName;
		}

		#endregion Constructors

		#region Public Methods

		/// <summary>
		/// <see cref="IActionResult"/>
		/// </summary>
		public void ExecuteResult(IControllerManager manager)
		{
			manager.RenderView(_viewName);
		}

		#endregion Public Methods
	}
}